package com.crm.controller;


import com.crm.base.PageResult;
import com.crm.domain.dto.BusinessDto;
import com.crm.domain.dto.TransferDto;
import com.crm.domain.vo.BusinessVo;
import com.crm.domain.vo.TransferVo;
import com.crm.service.TransferService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Slf4j
@Api(tags = "转派管理")
@RestController
@RequiredArgsConstructor
@RequestMapping("/transfer")
public class TransferController {
    private final TransferService transferService;

    /**
     * 转派列表
     * @param transferDto
     * @return
     */
    @ApiOperation(value = "转派列表")
    @GetMapping("/list")
    public PageResult<List<TransferVo>> page(TransferDto transferDto) {
        PageResult<TransferVo> pageResult = transferService.queryAll(transferDto);
        return PageResult.success(pageResult.getMsg(), pageResult.getRows(), pageResult.getTotal());
    }
}
